///*
// * Copyright The OpenTelemetry Authors
// * SPDX-License-Identifier: Apache-2.0
// */
//
//package com.xiashitech.agent.instrumentation.netty.netty_v4_common.server;
//
//import com.xiashitech.agent.instrumentation.netty.netty_v4_common.HttpRequestAndChannel;
//import io.netty.channel.socket.DatagramChannel;
//import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.net.InetSocketAddressNetServerAttributesGetter;
//
//import javax.annotation.Nullable;
//import java.net.InetSocketAddress;
//import java.net.SocketAddress;
//
//import static io.opentelemetry.javaagent.shaded.io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP;
//import static io.opentelemetry.javaagent.shaded.io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_UDP;
//
//final class NettyNetServerAttributesGetter
//    extends InetSocketAddressNetServerAttributesGetter<HttpRequestAndChannel> {
//
//  @Override
//  @Nullable
//  public String transport(HttpRequestAndChannel requestAndChannel) {
//    return requestAndChannel.channel() instanceof DatagramChannel ? IP_UDP : IP_TCP;
//  }
//
//  @Override
//  @Nullable
//  public InetSocketAddress getAddress(HttpRequestAndChannel requestAndChannel) {
//    SocketAddress address = requestAndChannel.remoteAddress();
//    if (address instanceof InetSocketAddress) {
//      return (InetSocketAddress) address;
//    }
//    return null;
//  }
//}
